import 'package:dailoz/constants.dart';
import 'package:dailoz/generated/l10n.dart';
import 'package:dailoz/size_config.dart';
import 'package:dailoz/views/add_page.dart';
import 'package:flutter/material.dart';

class AddTaskWidget extends StatelessWidget {
  const AddTaskWidget({
    Key? key,
    this.date,
    this.time,
  }) : super(key: key);

  final DateTime? date;
  final String? time;

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        const Divider(
          thickness: 1.0,
        ),
        SingleChildScrollView(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Text(
                "$time:00",
                style: Theme.of(context).textTheme.bodyText2?.copyWith(
                      fontWeight: FontWeight.bold,
                      fontSize: SizeConfig.getProportionateFontSize(14.0),
                    ),
              ),
              Text(
                S.of(context).NoSchedule,
                style: TextStyle(
                  color: const Color(0xff9aa8c7),
                  fontSize: SizeConfig.getProportionateFontSize(12.0),
                ),
              ),
              TextButton(
                onPressed: () {
                  Navigator.of(context).push(MaterialPageRoute(
                    builder: (context) => AddPage(
                      time: time,
                      date: date,
                    ),
                  ));
                },
                child: Text(
                  "+${S.of(context).addTask}",
                  style: Theme.of(context).textTheme.bodyText2?.copyWith(
                        fontSize: SizeConfig.getProportionateFontSize(14.0),
                      ),
                ),
              ),
            ],
          ),
        )
      ],
    );
  }
}
